Skip to content

Conversation

@ayloncarrijo
Copy link

@ayloncarrijo ayloncarrijo commented Sep 23, 2025

This PR introduces a new prettier.plugins setting in settings.json that allows for the automatic download and use of global Prettier plugins. This makes it easier to use Prettier with languages it doesn't support out of the box, without needing a package.json or local npm setup. It also simplifies quick one-off edits, allowing you to open a file, format it, and move on without additional configuration.

See #2828

  • Run tests
  • Update the CHANGELOG.md with a summary of your changes

@auto-assign auto-assign bot requested a review from ntotten September 23, 2025 18:34
@roele
Copy link

roele commented Nov 7, 2025

I tried installing a build of this PR but could not getting it to work properly. Plugins did not resolve as defined in the .prettierrc file for some reason.

What i am looking for is a way to use globally installed plugins. For example for non JS projects where we don't want a node_modules folder or package.json.

Ideally we could install prettier and plugins globally and then simply use them in the .prettierrc file. So far i could not get this to work properly. I can define the prettier.prettierPath to point to my globally installed prettier but the plugins are not resolved. Event with prettier.resolveGlobalModules set it does not load the plugins.

One workaround i found is to define the absolute paths to the plugins but that is ugly and does not work well across different OSes.

plugins:
  - "/Users/foo/.local/share/mise/installs/node/latest/lib/node_modules/prettier-plugin-java/dist/index.js"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants